// pages/totalSalary/totalSalary.js
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    wx.request({
      url: 'http://192.168.1.6:8080/WeChatJSON//allSalary',
      data: {
      },
      method: 'GET',
      header: {
        'content-type': 'application/json'
      },
      success:function(res){
        console.log(res)
        var info = res.data;var list = [];
        for(var i = 0;i < info.length;i++){
          if(info[i].flag == 1){
            list.push({
              ename: info[i].ename,
              empno: info[i].empno,
              orsal: info[i].orsal,
              newsal: info[i].newsal
            })
          }
          that.setData({
            list: list
          })
        }
      }
    })
  },

})